package com.hx.mybatisplus;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;

import java.io.File;

/**
 * @ClassName CustomConfig
 * @Description //TODO
 * @Author WHX
 * @Date 2021/12/9 14:03
 **/
public class CustomConfig {
    /**
     * 作者
     */
    public static final String AUTHOR = "yourName";
    /**
     * 绝对路径
     */
    public static final String PROJECT_PATH = System.getProperty("user.dir");
    public static final String JAVA_PATH = PROJECT_PATH + File.separator + "src\\main\\java";
    public static final String MAPPER_XML_PATH = PROJECT_PATH + File.separator + "src\\main\\resources";
    /**
     * 父包路径
     */
    public static final String PACKGE = "com.hx.mybatisplus.code";
    public static final String MODULENAME = "moudelname";

    /**
     * 主键key的类型
     */
    public static final Object MAPPER_ID_TYPE = "Integer";

    /**
     * 要过滤掉的字段（不需要在entity中生成的字段）
     */
    public static final String[] SUPER_ENTITY_COLUMS =new String[]{"id", "is_delete","create_time","update_time"};


    /**
     * Entity包名
     */
    public static final String ENTITY = "model";
    /**
     * Service包名
     */
    public static final String SERVICE = "service";
    /**
     * Service Impl包名
     */
    public static final String SERVICEIMPL = "service.impl";
    /**
     * Mapper包名
     */
    public static final String MAPPER = "dao";
    /**
     * Mapper XML文件夹名
     */
    public static final String XML = "mapper" +
            (StringUtils.isBlank(MODULENAME) ? "" : ("." + MODULENAME));
    /**
     * Controller包名
     */
    public static final String CONTROLLER = "controller";

    /**
     * 数据源配置，默认读取CHECK类的配置
     */
    public static class VM {
        public static final String HOST = "vm";
        public static final String PORT = "3306";
        public static final String USERNAME = "root";
        public static final String PASSWORD = "mysql5.7";
        public static final String DB_NAME = "whx";
        // 生成哪些表，多表逗号分隔
        public static final String TABLE_NAMES = "tenant_business_msg_type";
    }

    public static class CHECK {
        public static final String HOST = "127.0.0.1";
        public static final String PORT = "3306";
        public static final String USERNAME = "root";
        public static final String PASSWORD = "root";
        public static final String DB_NAME = "whx";
        // 生成哪些表，多表逗号分隔
        public static final String TABLE_NAMES = "user";
    }

}
